Class NewsRendererTest

java.lang.Object
com.fsf.news.renderer.NewsRendererTest

@ExtendWith(GuiceExtension.class) @ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class) class NewsRendererTest extends Object
Unit tests for the NewsRenderer class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) com.fasterxml.jackson.databind.ObjectMapper
     
    (package private) com.fsf.news.renderer.NewsRenderer
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Tests that the renderSearchResults method generates the expected HTML for a list of search results.
    (package private) void
    Tests that the renderSearchResults method generates an empty HTML string for an empty list of search results.
    (package private) void
    Tests that the renderSourceProfile method generates the expected HTML for a source profile.
    (package private) void
    Tests that the renderSourcesResults method generates the expected HTML for a list of sources results.
    (package private) void
    Tests that the renderSourcesResults method generates an empty HTML string when provided with an empty list of sources results.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • objectMapper

      @Inject @Named("objectMapperJSON") com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • renderer

      @InjectMocks com.fsf.news.renderer.NewsRenderer renderer
  • Constructor Details

    • NewsRendererTest

      NewsRendererTest()
  • Method Details

    • testRenderSearchResults

      @Test void testRenderSearchResults() throws IOException
      Tests that the renderSearchResults method generates the expected HTML for a list of search results.
      Throws:
      IOException - If an I/O error occurs
    • testRenderSearchResultsEmpty

      @Test void testRenderSearchResultsEmpty()
      Tests that the renderSearchResults method generates an empty HTML string for an empty list of search results.
    • testRenderSourcesResults

      @Test void testRenderSourcesResults() throws IOException
      Tests that the renderSourcesResults method generates the expected HTML for a list of sources results.
      Throws:
      IOException - If an I/O error occurs while reading test resources
    • testRenderSourcesResultsEmpty

      @Test void testRenderSourcesResultsEmpty()
      Tests that the renderSourcesResults method generates an empty HTML string when provided with an empty list of sources results.
    • testRenderSourceProfile

      @Test void testRenderSourceProfile() throws IOException
      Tests that the renderSourceProfile method generates the expected HTML for a source profile.
      Throws:
      IOException - If an I/O error occurs while reading test resources